package File;

import java.io.*;

public class lockFile {
    static String path = "java语法\\src\\File\\Files";
    static String childPath = "\\lty1.png";
    static String lockPath = "\\lty2.png";

    public static void main(String[] args) throws IOException {
        lockfile();
    }

    public static void lockfile() throws IOException {
        File file = new File(path, childPath);
        FileInputStream fis = new FileInputStream(file);
        FileOutputStream fos = new FileOutputStream(path + lockPath);
        int len;
        while ((len = fis.read()) != -1) {
            fos.write(len ^ 2);
        }
        fis.close();
        fos.close();
    }
}
